//
//  Douban.swift
//  test-ios
//
//  Created by wyz5204 on 2023/4/20.
//

import Foundation
import ObjectMapper

class Douban {
    
    // Objectapper
    class Object: Mappable {
        //频道列表
        var channels: [Channel]?
        
        init(){
        }
        
        required init?(map: Map) {
            channels <- map["channels"]
        }
        
        // Mappable
        func mapping(map: Map) {
            channels <- map["channels"]
        }
    }
    
    struct Channel : Mappable{
        
        var name: String?
        var nameEn:String?
        var channelId: String?
        var seqId: Int?
        var abbrEn: String?
        
        init?(map: Map) {
            name <- map["name"]
            nameEn <- map["name_en"]
            channelId <- map["channel_id"]
            seqId <- map["seq_id"]
            abbrEn <- map["abbr_en"]
        }
        
        mutating func mapping(map: Map) {
            name <- map["name"]
            nameEn <- map["name_en"]
            channelId <- map["channel_id"]
            seqId <- map["seq_id"]
            abbrEn <- map["abbr_en"]
        }
    }
    
    
}
